# $Id$
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=icewm
pkgver=1.3.8
pkgrel=4
pkgdesc="A Window Manager designed for speed, usability, and consistency"
arch=('i686' 'x86_64')
url="http://www.icewm.org/"
license=('LGPL')
depends=('libxrandr' 'libxft' 'libsm' 'libxinerama' 'gdk-pixbuf2')
makedepends=('xorg-mkfontdir')
source=(http://downloads.sourceforge.net/sourceforge/icewm/${pkgname}-${pkgver}.tar.gz
        ignore_workarea_hints.patch icewm-cpustatus.patch icewm-1.3.8-shutdown-reboot-command.patch
        icewm-1.3.8-remain_power.patch)
sha1sums=('dc9155227129be14aced00c24c572356e0fa5cd8'
          '88b4b198827d6590901c2c8bdba8826d928f6f1a'
          '0f4a02153496dadd26742f6bd3bdc166d7eafaed'
          'd85d35b756ca2d5283f10de9d9bca23d39c68f6f'
          '1c5e7361bec5f4775da86f663ecb397e711b8486')

prepare() {
  cd ${pkgname}-${pkgver}
  patch -p1 -i "${srcdir}/ignore_workarea_hints.patch"
  patch -p2 -i "${srcdir}/icewm-cpustatus.patch"
  patch -p1 -i "${srcdir}/icewm-1.3.8-shutdown-reboot-command.patch"
  patch -p1 -i "${srcdir}/icewm-1.3.8-remain_power.patch"
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr --sysconfdir=/etc \
    --enable-shaped-decorations --enable-gradients
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install install-man install-docs install-desktop
}
